import axios from 'axios';
import qs from 'query-string';
import {
  WxMaCodeDepositoryListQry,
  WxMaCodeDepositoryUptCmd,
  WxMaCodeDepositoryView,
} from '@/types/third/wx-ma-code-depository';

export function fetchWxMaCodeDepositoryList(params: WxMaCodeDepositoryListQry) {
  return axios.get<WxMaCodeDepositoryView[]>(
    '/third/wx/ma-code-depository/list',
    {
      params,
      paramsSerializer: (obj) => {
        return qs.stringify(obj);
      },
    }
  );
}

export function updateWxMaCodeDepository(data: WxMaCodeDepositoryUptCmd) {
  return axios.put('/third/wx/ma-code-depository', data);
}
